-
Notifications
You must be signed in to change notification settings - Fork 1k
Resolve memory leak in redisson instrumentation #10288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| if (commandsData.getCommands().size() == 1) { | ||
| return commandsData.getCommands().get(0).getCommand().getName(); | ||
| } else { | ||
| return "BATCH EXECUTE"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the spec allow this? From what I understand from https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-spans.md#call-level-attributes operation should not be set if there is more than one operation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
db.operation.name
I noticed that there is a description of the db.operation.name for batch statements in semantic-conventions, but I'm not sure if this is the one adjusted after this pull request
| default: | ||
| return String.join(";", sanitizedStatements); | ||
| } | ||
| return sanitizeStatement(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of omitting the statement when multiple statements are executed you could have changed it to only capture some small number X statements or limit the total length of the statement (there is a size limit to attributes anyway). Did you consider solving it this way?
|
@AlchemyDing Just curious is this a guess that this change will solve the OOM or are you able to repro it? |
# Conflicts: # instrumentation/redisson/redisson-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonRequest.java # instrumentation/redisson/redisson-common/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonAsyncClientTest.java # instrumentation/redisson/redisson-common/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonClientTest.java
resolve issue
When a large number of commands are sent to the Redis server at once using the
RedisConnection.send(CommandsData data)method, a significant number ofnormalizeSingleCommandoperations are executed. This can result in a long statement that takes up a large amount of memory or causes an Out-of-Memory (OOM) error. When users use batch execute, they usually do not pay attention to the specific content of each statement.